﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ProModel.ApplicationFramework.Silverlight;

namespace ProModelWindows.Silverlight.AST.Demo
{
    public partial class TestUserControl : UserControl
    {
        public TestUserControl()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ShowWindowedModal(OnDialogClosed, LayoutRoot);
        }

        private void ShowWindowedModal(DialogClose callback, Panel panel)
        {
            bool useCanvasPainting = false;
            WindowedModalControl wmc = new WindowedModalControl(callback, MsgBoxButtons.Cancel);
            wmc.HostedControl = new TestUserControl();
            wmc.ShowModal(panel, useCanvasPainting, new Size(400, 300));
            wmc.AllowResizing = false;
            wmc.AllowMaximize = true;
            wmc.TitleBarText = "Hi!  I'm a Modal!  Where do you want to go today?";
        }

        private bool OnDialogClosed(object sender, DialogExit e)
        {
            return true;
        }
    }
}
